Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as apigw from 'aws-cdk-lib/aws-apigateway'; | |
import * as cdk from 'aws-cdk-lib'; | |
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; | |
import * as lambda from 'aws-cdk-lib/aws-lambda'; | |
import * as nodeLambda from 'aws-cdk-lib/aws-lambda-nodejs'; | |
import * as path from 'path'; | |
import * as s3 from 'aws-cdk-lib/aws-s3'; | |
import { Construct } from 'constructs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as apigw from 'aws-cdk-lib/aws-apigateway'; | |
import * as cdk from 'aws-cdk-lib'; | |
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; | |
import * as lambda from 'aws-cdk-lib/aws-lambda'; | |
import * as nodeLambda from 'aws-cdk-lib/aws-lambda-nodejs'; | |
import * as path from 'path'; | |
import * as s3 from 'aws-cdk-lib/aws-s3'; | |
import { Construct } from 'constructs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sudo apt-get install portaudio19-dev python-all-dev python3-all-dev | |
#sudo apt-get install portaudio19-dev | |
#pip install SpeechRecognition numpy gTTs sklearn | |
#pip install gTTS | |
#sudo apt-get install mpg123 | |
import io | |
import random | |
import string | |
import warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Henkilötunnus 2023 regex - new finnish social security, regex to identify potential numbers | |
// Does not actually validate using the checksum | |
// Allows for case-insensitivity using the /i in the end. | |
// Includes test variables and tests, just copy the old-form regex or new one | |
const oldSsnRegex = /^(\d{6}[-+A]\d{3}\S{1})$/i; | |
/** Compatible with old-form */ | |
const newSsnRegex = /^(\d{6}[a-zA-Z]\d{3}\S{1})$/i; | |
/** Old-form social security numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cdk from 'aws-cdk-lib'; | |
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; | |
import * as s3 from 'aws-cdk-lib/aws-s3'; | |
import { Construct } from 'constructs'; | |
import { RemovalPolicy } from 'aws-cdk-lib'; | |
export interface StatefulStackProps extends cdk.StackProps { | |
bucketName: string; | |
} |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install -y libaio1 alien | |
# Change version based on https://www.oracle.com/de/database/technologies/instant-client/linux-x86-64-downloads.html | |
# Example alternative: http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.5-basiclite-19.5.0.0.0-1.x86_64.rpm | |
wget http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm | |
sudo alien -i --scripts oracle-instantclient*.rpm | |
rm -f oracle-instantclient*.rpm | |
# Optionally install SQLPlus | |
wget http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm | |
sudo alien -i --scripts oracle-instantclient*.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cdk from 'aws-cdk-lib'; | |
import { Construct } from 'constructs'; | |
import { EnvironmentConfig } from '../pipeline-types/pipeline-types'; | |
import { StatefulStack } from '../../app/stateful/stateful-stack'; | |
import { StatelessStack } from '../../app/stateless/stateless-stack'; | |
// this is our stage made up of multiple stacks which will be deployed to various environments | |
// based on config i.e. feature-dev, staging, prod, which also includes our application config | |
export class PipelineStage extends cdk.Stage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface EnvironmentConfig { | |
env: { | |
account: string; | |
region: string; | |
}; | |
stageName: string; | |
stateful: { | |
bucketName: string; | |
}; | |
stateless: { |
NewerOlder